<script setup>
import { artGetChannelsService } from '@/api/article'
import { onMounted, ref } from 'vue'
const list = ref([])
const getChannelList = async () => {
  const { data } = await artGetChannelsService()
  list.value = data.data
}
onMounted(() => {
  getChannelList()
})
defineProps({
  modelValue: {
    type: [Number, String]
  },
  width: {
    type: String
  }
})
const emit = defineEmits(['update:modelValue'])
</script>

<template>
  <el-select
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    :style="{ width }"
  >
    <el-option
      v-for="item in list"
      :key="item.id"
      :label="item.cate_name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>

<style scoped></style>
